package com.example.network_lib;

import android.content.pm.PackageInfo;

import com.example.network_lib.module.OrderDetailBean;
import com.example.network_lib.module.UpdateAppBean;
import com.example.network_lib.util.Tools;
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;

/**
 * 提交参数方式
 */
public class RequestUtils {

    /**
     * Get 请求demo
     *
     * @param context
     * @param observer
     */
    public static void getDemo(RxAppCompatActivity context, MyObserver<UpdateAppBean> observer) {
        RetrofitUtils.getApiInstance()
                .getUpdate(Tools.getAppVersion()).compose(RxHelper.observableIO2Main(context))
                .subscribe(observer);
    }


    public static void getOrderDetail(String mobile,String sourceH5Code,RxAppCompatActivity context, MyObserver<OrderDetailBean> observer) {
        RetrofitUtils.getApiInstance()
                .getOrderDetail(mobile,sourceH5Code).compose(RxHelper.observableIO2Main(context))
                .subscribe(observer);
    }
}

